<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>查询列表详情</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="X-UA-Compatible" content="IE=10" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<!------css样式------>
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/regulations.css">
</head>
<body>
	<!------IE浏览器判断------>
	<!--[if lt IE 9]>
<script type="text/javascript" src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->
	<jsp:include page="head.jsp"></jsp:include>
	<!------主内容区------>
	<div class="main">
		<div id="news" class="modal">
			<div class="position">
				<h4 class="clearfix">
					<span class="icon icon1"></span><span> 首页 > 查询结果 </span>
				</h4>
			</div>
			<div class="newsList-title clearfix">
				<h3 class="pull-left">查询结果</h3>
				<i></i>
			</div>
			<div class="new-content">
				<div class="search">
					<input type="search" name="company.comp_name" value="${comp_name }" id="searchId"> <input
						type="submit" value="搜索" onclick="searchcompany()">
				</div>
				
				<div class="search-list">
					<ul>
						<c:forEach items="${pb.beanlist }" var="c">
							<li><a href="company_findById?company.comp_id=${c.comp_id }">
									<h3>${c.comp_name }</h3>
									<p>
										<span class="elips">...</span> ${c.profile.pro_intro }
									</p>
							</a></li>
						</c:forEach>
					</ul>
				</div>
			</div>
		</div>
	</div>
	<!-- 页码开始 -->
	<div class="pagenations">
		<ul class="clearfix">
			<li><a onclick="changePage(1)" disabled="disabled"> 首页</a></li>
			<c:choose>
				<c:when test="${pb.currPage-1>0 }">
					<li><a onclick="changePage(${pb.currPage-1})" 
						disabled="disabled" style="cursor: pointer"> 上一页</a></li>
				</c:when>
				<c:otherwise>
					<li><a href="#"> 上一页</a></li>
				</c:otherwise>
			</c:choose>
			<c:choose>
				<c:when test="${pb.currPage+1<=pb.totalPage }">
					<li><a style="cursor: pointer" onclick="changePage(${pb.currPage+1})">
							下一页</a></li>
				</c:when>
				<c:otherwise>
					<li><a href="#"> 下一页</a></li>
				</c:otherwise>
			</c:choose>
			<li><a onclick="changePage(${pb.totalPage})">尾页</a></li>
			<li>第 <select onchange="changePg()" id="pageId">
					<c:forEach begin="1" end="${pb.totalPage }" var="n">
						<c:choose>
							<c:when test="${pb.currPage==n}">
								<option value="${n }" selected="selected">${n }</option>
							</c:when>
							<c:otherwise>
								<option value="${n }" >${n }</option>
							</c:otherwise>
						</c:choose>
					</c:forEach>
			</select> 页
			</li>
			<li>共 <span>${pb.totalCount }</span> 条记录
			</li>
			<li><span>${pb.currPage}/${pb.totalPage }</span> 页</li>
		</ul>
	</div>
	<div class="covers"></div>

	<!------页脚------>
	<jsp:include page="/foot.jsp"></jsp:include>
	<!------JS部分------>
	<script type="text/javascript">
	function changePage(i){
		//还要搜索回显
		var data = $("#searchId").val();
		window.location.href="company_findPbByName?currPage="+i+"&company.comp_name="+data;
	}
	
	function searchcompany(){
		var data = $("#searchId").val();
		window.location.href="company_findPbByName?company.comp_name="+data;
	}
</script>
<script type="text/javascript">
	function changePg(){
		//当前页码
		var n =$("#pageId").val();
		var data = $("#searchId").val();
		window.location.href="company_findPbByName?currPage="+n+"&company.comp_name="+data;
	}
</script>
</body>
</html>